package com.turman.coroutionsample

import android.util.Log
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlin.coroutines.CoroutineContext

/**
 * 协程全局异常捕获（不会阻止程序崩溃）
 */
class GlobalCoroutineExceptionHandler:CoroutineExceptionHandler {
    override val key = CoroutineExceptionHandler

    override fun handleException(context: CoroutineContext, exception: Throwable) {
        Log.d("buobao","Unhandled Coroutine Exception.")
    }
}